package lab03.test06;

import java.util.Comparator;
import java.util.Map;

/**
 * Created by ASUS on 2017/12/14.
 */
public class WordComparator implements Comparator<Object> {

    @Override
    public int compare(Object arg0, Object arg1) {
        Map.Entry<String,Integer> map1 = (Map.Entry<String,Integer>)arg0;
        Map.Entry<String,Integer> map2 = (Map.Entry<String,Integer>)arg1;
        return Integer.parseInt(map2.getValue().toString())
                - Integer.parseInt(map1.getValue().toString());
    }
}
